package com.attack.model;

import java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * 资金对照表
 * @author 14061748
 */
public class OrderMonthIncomeModel {
	
	 private String productCode;//产品编码
	 private BigDecimal  totalfinance; //资金投资 元
	 private String  periodNum; //期限 3月
	 private String  yearRate;//年化率 12%
	 private BigDecimal   yearCredit;//年化金额 
	 private BigDecimal   monthIncome;//月收益
	 private BigDecimal   totalIncome;//全部收益
	 private BigDecimal   realIncome;//全部收益
	DecimalFormat decimalFormat=new DecimalFormat(".00");
	
	public BigDecimal getTotalfinance() {
		return totalfinance;
	}
	public void setTotalfinance(BigDecimal totalfinance) {
		this.totalfinance = totalfinance;
	}
	public BigDecimal getYearCredit() {
		yearCredit= totalfinance.multiply(new BigDecimal(periodNum)).divide(new BigDecimal(12),0,BigDecimal.ROUND_HALF_UP);
		return yearCredit;
	}
	public void setYearCredit(BigDecimal yearCredit) {
		this.yearCredit = yearCredit;
	}
	public BigDecimal getMonthIncome() {
		BigDecimal monthIncome = ((totalfinance.multiply(new BigDecimal(yearRate))).divide((new BigDecimal(12).multiply(new BigDecimal(100))),0,BigDecimal.ROUND_HALF_UP));
		return monthIncome;
	}
	public void setMonthIncome(BigDecimal monthIncome) {
		this.monthIncome = monthIncome;
	}
	public String getPeriodNum() {
		return periodNum;
	}
	public void setPeriodNum(String periodNum) {
		this.periodNum = periodNum;
	}
	
	public String getYearRate() {
		return yearRate;
	}
	public void setYearRate(String yearRate) {
		this.yearRate = yearRate;
	}
	public BigDecimal getTotalIncome() {
		return  (totalfinance.multiply(new BigDecimal(yearRate)).multiply(new BigDecimal(periodNum))).divide(new BigDecimal(1200),0,BigDecimal.ROUND_HALF_UP);
	}
	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	public BigDecimal getRealIncome() {
		return realIncome;
	}
	public void setRealIncome(BigDecimal realIncome) {
		this.realIncome = realIncome;
	}
	
}
